﻿@model LoginViewModel

@if (Model.CurrentMembershipUser == null) {
	using (Html.BeginForm("Login", "Account", FormMethod.Post)) {
		<div class="auth">
			<div class="btn">
				<a href="@Url.Action("Login", "Account")">@Html.GetGlobalResource("LoginBar", "Login")</a>&nbsp;&nbsp;
				<a href="@Url.Action("Register", "Account")">@Html.GetGlobalResource("LoginBar", "Register")</a>
			</div>
		</div>
	}
}
else {
	
	var total = (Model.CurrentMembershipUser.Client.Finance!=null)? Model.CurrentMembershipUser.Client.Finance.Total:0;
	var totalBonus = Model.CurrentMembershipUser.Client.BonusFinances.Sum(m => m.Total);
	<div class="auth">
		<div class="cabinet">
			<div class="txt" style="width: 170px; text-align: left;">
				<a href="@Url.Action("Personal", "Cabinet")" style="text-decoration: none; font-weight: bold;">@Model.CurrentMembershipUser.UserName</a>
			</div>
			&nbsp;&nbsp;&nbsp;
			<a href="@Url.Action("Finance", "Cabinet")" 
			title="@Model.UsdToVsl" style="text-decoration: none;">
			<span class="many_main">@Html.GetCurrencyString(total)</span></a>
			&nbsp;&nbsp;&nbsp;
			<a href="@Url.Action("Online", "Cabinet")">@Html.GetGlobalResource("LoginBar", "MyCabinet")</a>
			&nbsp;&nbsp;&nbsp;
			<a href="@Url.Action("Logout", "Account")" style="float: right;">@Html.GetGlobalResource("LoginBar", "Logout")</a>
		</div>
	</div>
}